import React from 'react'
import { useRoutes, BrowserRouter } from 'react-router-dom'
import Loader from '@/component/lib/loader/loader'
import { routes } from './route'

function Router() {
  return useRoutes(routes)
}

export default class RouterApp extends React.Component {
  render() {
    return (
      <BrowserRouter>
        <React.Suspense fallback={<Loader />}>
          <Router />
        </React.Suspense>
      </BrowserRouter>
    )
  }
}
